#ifndef CHATPAGE_H
#define CHATPAGE_H

#include <QMainWindow>
#include <friendmode.h>
#include "userchatmode.h"
#include "networkcontroller.h"
#include <QEvent>

namespace Ui {
class ChatPage;
}

class ChatPage : public QMainWindow
{
    Q_OBJECT

public:
    ChatPage(QWidget *parent = nullptr);
    ChatPage(QWidget *parent = nullptr,const QString &username="",const QString &uid="");
    void setUserLayout(userChatmode *userchatmode);
    ~ChatPage();
protected:
    void closeEvent(QCloseEvent *ev) override;

private slots:
    void on_fontComboBox_currentFontChanged(const QFont &f);
    void recvMessage(const QString &user,const QString &text);

    void on_btn_send_clicked();

    void on_btn_cancle_clicked();



private:
    Ui::ChatPage *ui;
    QVector<userChatmode*> userChatVector;
};

#endif // CHATPAGE_H
